<template>
	<view class="list">
		<navigator v-for="(item,index) in data" :key="item._id" :url="`../detail/detail?_id=${item._id}`">
			<view class="list-item">
				<view class="q">
					<text>{{index + 1}}</text> .
					{{item.question}}
				</view>
				<view class="c">
					<text>{{item.name}}</text> |
					<text>{{item.text}}</text>
				</view>
			</view>
		</navigator>
	</view>
</template>

<script setup>
	// 自定义属性接收父组件传递的值
	defineProps(['data'])
</script>

<style lang="scss">
	.list {
		margin-top: 20rpx;

		.list-item {
			padding: 20rpx 12rpx;
			border-bottom: 1px solid #ccc;
			margin-bottom: 20rpx;

			.c {
				color: #666;
				font-size: 28rpx;
				margin-top: 12rpx;
				padding-left: 0rpx;
			}
		}
	}
</style>